export * from '/common/appConfig';

import * as commonConfig from '/common/appConfig';

// console.log('commonConfig', commonConfig);
// console.log('commonConfig', commonConfig.getAppCodes);

const commActTypes = commonConfig.commActTypes;

export const appConfig = {
  // 基础设置
  CORPORATION_SITE: {
    cn: '站点',
    modelName: 'host',
    appCode: 'CORPORATION_SITE',
    finderCode: 'FINDER_CORPORATIONSITE',
    authConfig: {
      moduleCode: 'api_base',
      functionCode: 'site',
      actionTypes: {
        ...commActTypes,
      },
    },
    // detailRoute: '/host/detail',
    api: {
      listApi: '/api/base/site/pub/query',
      detailApi: '/api/base/site/find',
      saveApi: '/api/base/site/save',
      delApi: '/api/base/site/delete',
    },
  },
  ROLE: {
    cn: '角色权限',
    modelName: 'role',
    appCode: 'API_WEB_ROLE',
    finderCode: 'FINDER_WEBROLE',//
    finderConfig: {
      actionType: 'global/findObjectList',
      reqApi: '/api-detect/admin/role/list',//'/api/base/role/pub/query', // 异步请求的 api
    },
    authConfig: {
      moduleCode: 'api-detect',
      functionCode: 'role',
      actionTypes: {
        ...commActTypes,
      },
    },
    // detailRoute: '/role/detail',
    api: {
      listApi: '/api-detect/admin/role/list', //'/api/base/role/pub/query',
      detailApi: '/api-detect/admin/role/findDetail',//'/api/base/role/find',
      saveApi: '/api-detect/admin/role/save',//'/api/base/role/save',
      delApi: '/api-detect/admin/role/delete',//'/api/base/role/delete',

      // 权限
      secQuery: '/api-detect/admin/src_sec/list',
    },
  },
  EMPLOYEE_CATEGORY: {
    cn: '员工类型',
    modelName: 'employeeType',
    appCode: 'EMPLOYEE_CATEGORY',
    finderCode: 'FINDER_EMPLOYEECATEGORY',
    finderConfig: {
      actionType: 'global/findObjectList',
      reqApi: '/api-detect/admin/empType/list',//'/api/base/role/pub/query', // 异步请求的 api
    },
    authConfig: {
      moduleCode: 'api-detect',
      functionCode: 'empCate',
      actionTypes: {
        ...commActTypes,
      },
    },
    // detailRoute: '/employeeType/detail',
    api: {
      listApi: '/api-detect/admin/empType/list',
      detailApi: '/api-detect/admin/empType/findDetail',
      saveApi: '/api-detect/admin/empType/save',
      delApi: '/api-detect/admin/empType/delete',
    },
  },

  DEPARTMENT: {
    cn: '所属部门',
    modelName: 'department',
    appCode: 'DEPARTMENT',
    finderCode: 'FINDER_DEPARTMENT',
    finderConfig: {
      actionType: 'global/findObjectList',
      reqApi: '/api-detect/admin/dept/list', // 异步请求的 api
    },
    authConfig: {
      moduleCode: 'api-detect',
      functionCode: 'dept',
      actionTypes: {
        ...commActTypes,
      },
    },
    // detailRoute: '/department/detail',
    api: {
      listApi: '/api-detect/admin/dept/list',
      detailApi: '/api-detect/admin/dept/findDetail',
      saveApi: '/api-detect/admin/dept/save',
      delApi: '/api-detect/admin/dept/delete',
    },
  },
  JOB: {
    cn: '职务',
    modelName: 'job',
    appCode: 'JOB',
    finderCode: 'FINDER_JOB',
    finderConfig: {
      actionType: 'global/findObjectList',
      reqApi: '/api/base/job/pub/query', // 异步请求的 api
    },
    authConfig: {
      moduleCode: 'api_base',
      functionCode: 'job',
      actionTypes: {
        ...commActTypes,
      },
    },
    // detailRoute: '/department/detail',
    api: {
      listApi: '/api/base/job/pub/query',
      detailApi: '/api/base/job/find',
      saveApi: '/api/base/job/save',
      delApi: '/api/base/job/delete',
    },
  },
  EMPLOYEE: {
    cn: '员工',
    modelName: 'employee',
    appCode: 'EMPLOYEE',
    finderCode: 'FINDER_EMPLOYEE',
    finderConfig: {
      actionType: 'global/findObjectList',
      reqApi: '/api-detect/admin/empInfo/list', // 异步请求的 api
      // toggleStateApi: '/api/base/user/toggleState',
      // toggleISMakeApi:'/api-detect/admin/empInfo/makeDefault',
    },
    resCode: 'EMP', // 该【核算对象】在【资源池】中的标识
    authConfig: {
      moduleCode: 'api-detect',
      functionCode: 'empInfo',
      actionTypes: {
        ...commActTypes,
        resetPassword: 'resetPassword',
        toggleState: 'toggleState',
        makeDefault: 'makeDefault',
      },


    },
    // detailRoute: '/employee/detail',
    api: {
      listApi: '/api-detect/admin/empInfo/list',
      detailApi: '/api-detect/admin/empInfo/findDetail',
      saveApi: '/api-detect/admin/empInfo/save',
      delApi: '/api-detect/admin/empInfo/delete',
      resetPsw: '/api-detect/admin/empInfo/resetPassword',
    },
  },
};

export const appCodes = commonConfig.getAppCodes(appConfig);


